<?
/**
 * Event database object
 */
class Event extends EventDbo {

/**
 * constructer
 */
public function __construct() {
	parent::__construct();
	}

/**
 * Getters
 */
public function CategoryId() {
	return $this->getProperty('CategoryId');
	}
public function CategoryColor() {
	return $this->GetCategory()->getProperty('Color');
	}
public function CategoryTag() {
	return $this->GetCategory()->getProperty('Tag');
	}
public function EventDate() {
	return $this->getProperty('EventDate');
	}
public function EventText() {
	return $this->getProperty('EventText');
	}
public function Enabled() {
	return $this->getProperty('Enabled');
	}
public function GetCategory() {
	$o = getDbo('CategoryDbo');
	$o->resetProperties();
	$o->populateFromDb($this->CategoryId());
	return $o;
	}
public function GetSource() {
	$o = getDbo('SourceDbo');
	$o->resetProperties();
	$o->populateFromDb($this->SourceId());
	return $o;
	}
public function Id() {
	return $this->getProperty('Id');
	}
public function SourceId() {
	return $this->getProperty('SourceId');
	}
public function Source() {
	return $this->GetSource()->getProperty('Source');
	}

/**
 * Can the currently populated item be deleted?
 * @return bool
 */
public function canDelete() {
	return ($this->populated);
	}

/**
 * Delete currently populated object, taking care of linked objects first.
 * @return bool true on success
 * @return string error message on failures.
 */
public function delete() {
	if (!$this->canDelete()) {
		return 'Item cannot be deleted at this time.';
		}
	return parent::delete();
	}

/**
 * Obtain standardized object list.
 * @return array
 */
public function getList() {
	$this->searchReset();
	$this->setSearchSelect('Id');
	$this->setSearchSelect('EventDate');
	$this->setSearchSelect('EventText');
	$this->setSearchOrder('EventDate');
	return $this->query();
	}

}
?>
